# coding=utf-8
"""
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?

翻译:

2,3,5,7,11,和13是素数的前6个,第6个素数是13.
第10001个素数是什么?
"""

MAX = 200000
TARGET = 10001

flag = []
prim = []

for i in range(0, MAX):
    prim.append(i)
    flag.append(False)

flag[0] = True
flag[1] = True

for i in range(2, MAX):
    if not flag[i]:
        for j in range(2, MAX / i):
            flag[i * j] = True

index = 0
for i in range(0, MAX):
    if not flag[i]:
        index += 1
    if index == TARGET:
        print prim[i]
        break

# 104743